//引入封装好的request
import { request } from '../../request/index.js'
Page({
  data: {
    swiperList: [],
    navList:[],
    contentList:[]
  },
  //options(Object)
  onLoad: function (options) {
    this.banner()
    this.nav()
    this.content()
  },
  //获取轮播图数据
  banner(){
    request({ url: "/home/swiperdata" })
    .then((res) => {
      this.setData({
        swiperList: res
      })
    })
  },
  nav(){
    request({url:"/home/catitems"})
    .then((res)=>{
      this.setData({
        navList:res
      })
    })
  }, 
  content(){
    request({url:"/home/floordata"})
    .then((res)=>{
      this.setData({
        contentList:res
      })
    })  
  }
});
